
/*--------------------------------------------------------------
user_udp_s_axis_tuser:
[63:48]---tx_target_port
[47:16]---tx_target_ip
[15:0]---tx_data_len

user_udp_m_axis_tuser:
[63:48]---rx_source_port
[47:16]---rx_source_ip
[15:0]---rx_data_len

udp_s_axis_tuser:
[55:24]---rx_ip_source_ip
[23:16]---rx_pkg_type
[15:0]---rx_ip_data_len

udp_m_axis_tuser:
[55:24]---tx_ip_target_ip
[23:16]---tx_pkg_type  udp=17
[15:0]---tx_ip_data_len
--------------------------------------------------------------*/

module ethernet_udp_top #(
    parameter   SOURCE_PORT         = 16'd5001                                   
)(
    input                           i_clk                               ,
    input                           i_rst                               ,
    input                           i_set_source_port_valid             ,
    input   [15: 0]                 i_set_source_port                   ,
    output                          user_udp_m_axis_tvalid              ,
    output  [7 : 0]                 user_udp_m_axis_tdata               ,
    output                          user_udp_m_axis_tlast               ,
    output  [63: 0]                 user_udp_m_axis_tuser               ,  
    input                           user_udp_s_axis_tvalid              ,
    input   [7 : 0]                 user_udp_s_axis_tdata               ,
    output                          user_udp_s_axis_tready              ,
    input                           user_udp_s_axis_tlast               ,
    input   [63: 0]                 user_udp_s_axis_tuser               ,
    input                           udp_s_axis_tvalid                   ,
    input   [7 : 0]                 udp_s_axis_tdata                    ,
    input                           udp_s_axis_tlast                    ,
    input   [71: 0]                 udp_s_axis_tuser                    , 
    output                          udp_m_axis_tvalid                   ,
    output  [7 : 0]                 udp_m_axis_tdata                    ,
    input                           udp_m_axis_tready                   ,
    output                          udp_m_axis_tlast                    ,
    output  [55: 0]                 udp_m_axis_tuser                    
);

    udp_rx #(
        .SOURCE_PORT                ( SOURCE_PORT               )
    ) udp_rx_inst0(
        .i_clk                      ( i_clk                     ),
        .i_rst                      ( i_rst                     ),
        .i_set_source_port_valid    ( i_set_source_port_valid   ),
        .i_set_source_port          ( i_set_source_port         ),
        .s_axis_tvalid              ( udp_s_axis_tvalid         ),
        .s_axis_tdata               ( udp_s_axis_tdata          ),
        .s_axis_tlast               ( udp_s_axis_tlast          ),
        .s_axis_tuser               ( udp_s_axis_tuser          ),
        .m_axis_tvalid              ( user_udp_m_axis_tvalid    ),
        .m_axis_tdata               ( user_udp_m_axis_tdata     ),
        .m_axis_tlast               ( user_udp_m_axis_tlast     ),
        .m_axis_tuser               ( user_udp_m_axis_tuser     )
    );

    udp_tx #(
        .SOURCE_PORT                ( SOURCE_PORT               )
    ) udp_tx_inst0 (
        .i_clk                      ( i_clk                     ),
        .i_rst                      ( i_rst                     ),
        .i_set_source_port_valid    ( i_set_source_port_valid   ),
        .i_set_source_port          ( i_set_source_port         ),
        .s_axis_tvalid              ( user_udp_s_axis_tvalid    ),
        .s_axis_tdata               ( user_udp_s_axis_tdata     ),
        .s_axis_tready              ( user_udp_s_axis_tready    ),
        .s_axis_tlast               ( user_udp_s_axis_tlast     ),
        .s_axis_tuser               ( user_udp_s_axis_tuser     ),
        .m_axis_tvalid              ( udp_m_axis_tvalid         ),
        .m_axis_tdata               ( udp_m_axis_tdata          ),
        .m_axis_tready              ( udp_m_axis_tready         ),
        .m_axis_tlast               ( udp_m_axis_tlast          ),
        .m_axis_tuser               ( udp_m_axis_tuser          )
    );






endmodule
